﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="user_favimg_albums.aspx.cs" Inherits="user_favimg_albums" Title="Quản lý album" %>
<%@ Register Src="~/UserControls/Advertising.ascx" TagName="Adv" TagPrefix="uc" %>
<%@ Register Src="~/UserControls/left_user.ascx" TagName="MenuLeft" TagPrefix="uc" %>
<%@ Import Namespace="ThoiTrang.Business" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentCss" runat="Server">
    <link href="css/reg.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="js/validate.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentFooter" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentMenu" runat="Server">
    <uc:MenuLeft ID="menuLeft" runat="server" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentMain" runat="Server">
                    <div class="reg-wrap">
                        <h3>
                            <img src="images/quan-ly-album-hp.gif" alt="thoi trang" width="400" height="40" /></h3>
                        <!--Reg-->
                        <div class="reg">
                            <div class="group fl simple">
                            <p id="InfoText" runat="server" visible=false>Đã tạo tên album!</p>
                                <div>
                                    <label for="ten_album">
                                        Tên Album</label>
                                    <input id="ten_album" name="Name" size="35" type="text" value="<%=edit?album.Name:"" %>" />
                                </div>
                                <div>
                                    <label for="loai_album">
                                        Loại Album</label>
                                    <select id="loai_album" name="AlbumType">
                                        <option value="false" <%=edit?(album.AlbumType==false?"selected":""):"" %>>Đồ tôi thích</option>
                                        <option value="true" <%=edit?(album.AlbumType==true?"selected":""):"" %>>Đồ tôi muốn mua</option>
                                    </select>
                                </div>
                                <div style="overflow:hidden; width:100%;">
                                <input type="hidden" name="idAb" value="<%=edit?album.ID:0 %>" />
                                <input class="submitbutton" name="act" type="submit" value="add" />
                                <%
                                    if (edit)
                                    {
                                     %>
                                <input class="submitbutton" name="act" type="submit" value="update" style=" width:100px; margin-left:2px;" />
                                <%
                                    } %>
                                </div>
                            </div>
                            <div class="sort">
                                <ul>
                                    <li><a href="user_favimg_albums.aspx?ckid=<%=SessionManager.GetCookie() %>">All</a></li>
                                    <%--<li><a href="user_favimg_albums.aspx?fn=A&amp;ckid=<%=SessionManager.GetCookie() %>">A</a></li>
                                    <li><a href="#">T</a></li>--%>
                                </ul>
                            </div>
                            
                            <table id="fav_table" width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr class="cap">
                                    <td width="43%">
                                        Tên Album
                                    </td>
                                    <td width="43%">
                                        Loại Album
                                    </td>
                                    <td width="14%">
                                        Thao Tác
                                    </td>
                                </tr>
                                <%
                                    if (albums != null)
                                    {
                                        bool flag = true;
                                        foreach (a_Album ab in albums.ToArray())
                                        {
                                     %>
                                <tr class="row_<%=flag?"a":"b" %>">
                                    <td class="title">
                                        <%=ab.Name%> <span>(<%
                                                                a_FavoriteCollection fav = a_FavoriteService.Geta_FavoriteListByAlbumID(ab.ID, a_FavoriteColumns.ID, ThoiTrang.Data.OrderDirection.ASC);
                                                                Response.Write(fav.Count);
                                             %>)</span>
                                    </td>
                                    <td>
                                        <%=ab.AlbumType == false ? "Đồ tôi thích" : "Đồ tôi muốn mua"%>
                                    </td>
                                    <td>
                                        <a href="user_favimg_albums.aspx?AlbumID=<%=ab.ID %>&fn=&ckid=<%=SessionManager.GetCookie() %>">
                                            <img src="images/ico_edit.gif" alt="edit" width="12" height="12" /></a>
                                            <a href="user_favimg_albums.aspx?AlbumID=<%=ab.ID %>&act=del&ckid=<%=SessionManager.GetCookie() %>&fn=">
                                            <img src="images/ico_delete.gif" alt="delete" width="16" height="13" /></a>
                                    </td>
                                </tr>
                                <%
                                            flag = !flag;
                                        }
                                    }%>
                            </table>
                        </div>
                        <!--//Reg-->
                    </div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentLeft" runat="Server">
    <uc:Adv runat="server" />
</asp:Content>
